<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa  fa-fw fa-reorder"></i>添加分类
                        </li>
                    </ol>
                </div>
            </div>
            
            <form action="#" method="post">
                <div class="form-group">
                    <label for="title">分类标题</label>
                    <input type="text" placeholder="输入分类标题" id="title" class="form-control" name="title" />
                </div>
                <div class="form-group">
                    <label for="pid">父分类</label>
                    <select class="form-control" id="pid" name="pid">
                        <option value="">顶级分类</option>
<?foreach($tCatelist as $tRow){?>
<option value="<?=$tRow['id']?>"><?=$tRow['html']?><?=$tRow['title']?></option>
<?}?>
                    </select>
                </div>
                <div class="form-group">
                    <label for="name">分类别名</label>
                    <input type="text" placeholder="输入分类别名,不能和其他分类别名重复" id="name" class="form-control" name="name" />
                </div>
                <div class="form-group">
                    <label for="keywords">关键词</label>
                    <input type="text" placeholder="请输入SEO关键词(选填)" id="keywords" class="form-control" name="keywords" />
                </div>
                <div class="form-group">
                    <label for="description">描述信息</label>
                    <textarea placeholder="请输入分类描述（选填" class="form-control" rows="10" cols="30" id="description" name="description"></textarea>
                </div>
                <button class="btn btn-primary demo_2" type="button" id="submit">添加</button>
            </form>   
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->

<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
<script>
    $('#submit').click(function(){
        swal('提交中...');
        $.post('/admin_category/add',$('form').serialize(),function(obj){
            cg_alert_add(obj,'/admin_category','/admin_category/add');
        });
    });
</script>


